home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / finance / sst33.zip / SAMPLE.BAS < prev    next >
BASIC Source File  |  1993-02-25  |  5KB  |  113 lines

  1. DEFINT A-Z
  2. '
  3. '     Sample program on how to set up your code for using "SSTPATCH.EXE".
  4. '     This Sample Program is laid out in MicroSoft Quick Basic format, but
  5. '     we have only used "Entry Level" Basic commands. This type of "Patch"
  6. '     will "definitely" work with Microsoft Quick Basic "EXE" files, & will
  7. '     "possibly" work with many other types of "EXE" files. It all depends
  8. '     upon how the DATA statements are stored inside of the "EXE" files,
  9. '     and if the character count on the data lines remains constant. We
  10. '     have not found ANY source code using "Line Numbers" that will work
  11. '     with SST-PATCH.
  12. '
  13. '
  14. '   <<<<<<<<<<<<<<<<<<============================>>>>>>>>>>>>>>>>>>>
  15. '   |||||||||||||||||| YOUR PROGRAM'S SOURCE CODE |||||||||||||||||||
  16. '   <<<<<<<<<<<<<<<<<<============================>>>>>>>>>>>>>>>>>>>
  17. '
  18. CLS
  19. PRINT "LET'S PRETEND THIS IS THE FIRST LINE OF YOUR MAIN SOURCE CODE"
  20. '
  21. '     The 'body' of your main program's source code
  22. '              would be placed in here.
  23. '                      Many, many
  24. '                           lines long.
  25. '
  26. PRINT "LET'S PRETEND THIS IS THE LAST LINE OF YOUR MAIN SOURCE CODE"
  27. GOSUB ShowPatch          'REM to display the new patch.
  28. CLOSE : END: SYSTEM
  29. '
  30. '   <<<<<<<<<<<<<<<<<<============================>>>>>>>>>>>>>>>>>>>
  31. '   ||||||||||||||||||   END OF YOUR SOURCE CODE  |||||||||||||||||||
  32. '   <<<<<<<<<<<<<<<<<<============================>>>>>>>>>>>>>>>>>>>
  33. '
  34. '
  35. '
  36. '
  37. '     Now, after the last line of code in your main program module,
  38. '     insert the following "DATA" lines. Make the entries EXACTLY
  39. '     as we have them. When "messing around" with binary "stuff",
  40. '     character counting is "everything".
  41. '
  42. '     Caution!
  43. '         - NO TRAILING "SPACEBARS" ON THE DATA ENTRY LINES
  44. '         - NO "REMARKS" ON THE DATA ENTRY LINES
  45. '         - NO OTHER CHARACTERS OF ANY KIND ON DATA ENTRY LINES
  46. '         - WHEN WE SAY "EXACTLY" - WE MEAN "EXACTLY!
  47. '
  48. '
  49. '
  50. DATA "Customer_Name_And_Number"
  51. DATA "123456789012345678901234567890"
  52. DATA "12345678"
  53. DATA "12345"
  54. '
  55. '
  56. '
  57. '     The 1st DATA line is a "File Place Marker" or "File Flag" only.
  58. '     The 2nd DATA line will hold a Customer's Name (Max Length = 30)
  59. '     The 3ed DATA line will contain your currently set "System Date"
  60. '     The 4th DATA line will contain up to a 5 digit Serial Number
  61. '
  62. '     That's all there is to it. Now compile and link your source code
  63. '     into an "EXE" file, and then run "SSTPATCH.EXE". The entries in the
  64. '     above "DATA" statements will be replaced with your customer's data.
  65. '     You can then view the patch with any good binary editor, or simply
  66. '     add something like the commands in "ShowPatch" to your source code
  67.  
  68. '
  69. '     Once the above DATA lines are in place, you can patch the same EXE
  70. '     file over and over again with different information as many times
  71. '     as you wish. The System Date is always used, so set your calendar.
  72. '
  73. '
  74. '
  75. ShowPatch:
  76. '     To display the patched data on screen, you could do something like....
  77. READ X$, NAME$, DT$, SER$
  78. PRINT
  79. PRINT "'SAMPLE.EXE' - THE PATCHED ENTRIES ARE...."
  80. PRINT
  81. PRINT "Customer's Name......: "; NAME$
  82. PRINT "Date Of Transaction..: "; DT$
  83. PRINT "Product Serial #.....: "; SER$
  84. RETURN
  85. '
  86. '
  87. '
  88. '     The file called "SAMPLE.EXE" is a compiled version of this source code.
  89. '     Try SSTPATCH to patch SAMPLE.EXE to see how all of this works.
  90. '
  91. '
  92. '     **********************************************************************
  93. '
  94. '     Note: Common reasons why an EXE file won't work after a patch:
  95. '
  96. '  -  You used a punctuation mark in your "CUSTOMER NAME"  entry.
  97. '           Some of these characters will cause problems,  others work
  98. '           just fine. The first time you try to patch a program, don't
  99. '           try  to  get fancy - Just enter  Alpha/Numeric  characters.
  100. '
  101. '  - You left trailing "spacebars" at the end of the "DATA" lines.
  102. '          There must be NO other characters of any kind after the last
  103. '          quote mark on any "DATA" line entry (not even a REMark).
  104. '
  105. '  - You didn't enter the "DATA" lines EXACTLY as we show them in
  106. '          the examples in "SAMPLE.BAS". If you are using Quick Basic,
  107. '          load "SAMPLE.BAS" along with your own program, and then
  108. '          "copy" the data lines from Sample.Bas to your program with
  109. '          Quick Basic's "Cut & Paste" feature.
  110. '
  111. '************************************************************************
  112.  
  113.